<?php
/**
 * Joomla! 1.5 component JoomGPSTracks
 *
 * @version $Id: default.php 2009-08-13 15:40:19 svn $
 * @author Michael Pfister
 * @package joomGPStracks
 * @subpackage backend
 * @license GNU/GPL
 * @filesource
 *
 */

defined('_JEXEC') or die('Restricted access');

// toolbar
JToolBarHelper::title(JText::_('GPS_COMMENTS'), 'categories.png');
JToolBarHelper::back($alt= 'Back', $href= 'javascript:history.back();');
JToolBarHelper::spacer();
JToolBarHelper::editList('editComment');
JToolBarHelper::publish();
JToolBarHelper::unpublish();
JToolBarHelper::deleteList();

JHTML::_('behavior.tooltip');
?>
<form action="index.php" method="post" name="adminForm">
    <table class="adminlist" cellpadding="1">
        <thead>
            <tr>
                <th width="5%" class="title"><?php echo JText::_( 'NUM' ); ?></th>
                <th width="5%" class="title">
                    <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->rows); ?>);" />
                </th>
                <th width="10%" class="title"><?php echo JText::_('user'); ?></th>
                <th width="15%" class="title"><?php echo JText::_('GPS_TRACK'); ?></th>
                <th width="29%" class="title"><?php echo JText::_('title'); ?></th>
                <th width="10%" class="title"><?php echo JText::_('date'); ?></th>
                <th width="10%" class="title"><?php echo JText::_( 'State'); ?></th>
                <th width="2%" class="title" nowrap="nowrap"><?php echo JText::_( 'ID'); ?></th>
	    </tr>
         </thead>
        <tfoot>
            <tr>
                <td colspan="8">
                    <?php echo $this->pagination->getListFooter(); ?>
                </td>
            </tr>
        </tfoot>
         <tbody>
         <?php
	$k = 0;
	for ($i=0, $n=count( $this->rows ); $i < $n; $i++)
	{
		$row = &$this->rows[$i];

		$link 	= JRoute::_( 'index.php?option=com_joomgpstracks&task=editterrain&controller=terrain&id='. $row->id );

		$checked 	= JHTML::_('grid.checkedout',   $row, $i );
		$published 	= JHTML::_('grid.published', $row, $i );

             ?>
             <tr class="<?php echo "row$k"; ?>">
                <td align="center"><?php echo $this->pagination->getRowOffset( $i ); ?></td>
                <td align="center"><?php echo $checked; ?></td>
                <td align="center"><?php echo $row->user; ?></td>
                <td align="center"><?php echo $row->track; ?></td>
                <td align="center"><span class="hasTip" title="<?php echo JText::_('GPS_COMMENT_TEXT'); ?> :: <?php echo $row->text; ?>"><?php echo $row->title; ?></span></td>
                <td align="center"><?php echo $row->date; ?></td>
                <td align="center"><?php echo $published;?></td>
                <td><?php echo $row->id; ?></td>
             </tr>
             <?php
             $k = 1 - $k;
         }
         ?>
         </tbody>
    </table>
    <input type="hidden" name="option" value="com_joomgpstracks" />
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="boxchecked" value="0" />
    <input type="hidden" name="controller" value="comments" />
    <?php echo JHTML::_( 'form.token' ); ?>
</form>